<%@page import="Entities.*"%>
<%@page import="Helpers.*"%>
<%@page import="Hibernate.*"%>
<%@page import="java.util.List"%>

<%
        String user = (String) request.getParameter("login");
        String ww   = (String) request.getParameter("wachtwoord");
        String pad  = (String) request.getParameter("pad");

        if(user != null){
            if(ww != null){
                PersonenHelper pHelper = new PersonenHelper();
                String pid = pHelper.getLogin(user, ww);
                if (pid == null) {
                    response.sendRedirect("index.jsp?error=true");
                }
                else {

                      Personen persoon = pHelper.getPersoon(Integer.parseInt(pid));
                      session.setAttribute("rol", persoon.getRollen().getId().toString());
                      session.setAttribute("pid", persoon.getId().toString());
                      response.sendRedirect(pad);

                      %><%=pad%><%
                  }
               }
            }

        %>

